package com.levi;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @author shentong
 * @since 2022/3/8 9:34 PM
 */
@EnableAsync
@Slf4j
@SpringBootApplication
@MapperScan(basePackages = { "com.levi.mapper" })
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableRetry
public class Application {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
		ConfigurableEnvironment environment = context.getEnvironment();
		String port = environment.getProperty("server.port");
		log.info("端口号是:=>>>{}",port);

		String[] beanDefinitionNames = context.getBeanDefinitionNames();
		for (String beanDefinitionName : beanDefinitionNames) {
			if ("testRegistryPostProcessor".equalsIgnoreCase(beanDefinitionName)) {
				log.info("包含testRegistryPostProcessor定义");
			}
		}
	}

}
